<template>
<div class="wrap">
<xcl-header :page-title="pageTitle" :header-right="headerRight"></xcl-header>

<div class="content">
	<div v-if="myOrder.length == 0 && loading.show === false" class="no-data">暂无数据</div>
  	<div class="card" transition="fade" v-for="p in myOrder">
	    <div class="card-content lh">
	      	<div class="card-content-inner">
		        <div class="item-inner">
		          <div class="item-title row">
		          		<div class="t3 col-100">{{p.t1 | getLastTimeStr}}</div>
		          </div>
		        </div>
		         <div class="item-inner">
		          <div class="item-title row">
		          		<div class="col-100" style="font-size:.8rem;">{{p.t2}}</div>
		          </div>
		        </div>
		         <div class="item-inner">
		          <div class="item-title row">
		          		<div class="t2 col-100">{{p.c}}</div>
		          </div>
		        </div>
	      	</div>
	    </div>
  </div>

</div>

  <xcl-loading :show="loading.show"></xcl-loading>
  </div>
</template>
<script>
import xclHeader from '../components/header.vue'
import xclFooter from '../components/footer.vue'
import xclLoading from '../components/loading.vue'
import xclTab from '../components/tab.vue'
let UserProxy =  require("../proxy/user_proxy");
let User = new UserProxy();
let MessageProxy =  require("../proxy/message_proxy");
let Message = new MessageProxy();
  export default {
        data (){
            return {
                scroll:true,
                pageTitle:'消息通知',
                headerRight:'',
                user:{
                	nickName:localStorage.nickName,
                	img:'/src/asserts/images/user.png'
                }, 
                myOrder:[],            
                loading:{
                    show:false
                }
            }
        },
        route:{
        },
        methods:{
        	getMyProducts(order){
        		var _this = this;
        		_this.loading.show = true;
        		Message.getMyMessages(localStorage.token,1,0,new Date()*1,0,1,50,(d)=>{
        			if(d.code == 200 && d.results && d.results.length){
        				_this.myOrder = d.results;
        			}else{
                        _this.myOrder = [];
                    }
                    _this.loading.show = false;

        		});
        	},
            setMessageRead(){
                Message.setMyAllMessageRead(localStorage.token,1,function(data){
                    if(data.code==200){
                        // UserManager.getNewMessageCount(true);
                    }
                });
            }
        },
        ready(){
        	this.getMyProducts(-1);
        },
        components:{
           "xclHeader":xclHeader,
           "xclFooter":xclFooter,
           "xclLoading":xclLoading,
           "xclTab":xclTab
        }
  }
</script>
<style lang="stylus">
	.message-account
		padding:0 0.3rem
		background-color:red
		border-radius:0.5rem
		font-size:0.5rem
	.lh	
		line-height 1.7em
</style>